package com.qingcloud.base.api.remote.eqcenter.factory;
import com.qingcloud.base.api.remote.eqcenter.EqcenterApi;
import com.qingcloud.base.api.remote.eqcenter.fallback.EqcenterApiFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class EqcenterApiFallbackFactory implements FallbackFactory<EqcenterApi> {
    @Override
    public EqcenterApi create(Throwable throwable) {
        EqcenterApiFallback fallback = new EqcenterApiFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
